package com.nc.util;

import java.util.List;

/**
 * @author Administrator
 * @create 2020-08-05 9:22
 * @desc 分页工具类
 **/
public class PageUtil<E> {
    /**数据*/
    private List<E> data;
    /**当前页码*/
    private Integer currPage;
    /**上一页*/
    private Integer prevPage;
    /**下一页*/
    private Integer nextPage;
    /**首页*/
    private Integer homePage;
    /**尾页*/
    private Integer endPage;
    /**总页数*/
    private Integer totalPage;
    /**总记录数*/
    private Integer numPage;

    public List<E> getData() {
        return data;
    }

    public void setData(List<E> data) {
        this.data = data;
    }

    public Integer getCurrPage() {
        return currPage;
    }

    public void setCurrPage(Integer currPage) {
        this.currPage = currPage;
    }

    public Integer getPrevPage() {
        prevPage = getCurrPage()-1;
        return prevPage;
    }

    public void setPrevPage(Integer prevPage) {
        this.prevPage = prevPage;
    }

    public Integer getNextPage() {
        nextPage = getCurrPage()+1;
        return nextPage;
    }

    public void setNextPage(Integer nextPage) {
        this.nextPage = nextPage;
    }

    public Integer getHomePage() {
        homePage = 1;
        return homePage;
    }

    public void setHomePage(Integer homePage) {
        this.homePage = homePage;
    }

    public Integer getEndPage() {
        return endPage;
    }

    public void setEndPage(Integer endPage) {
        this.endPage = endPage;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getNumPage() {
        return numPage;
    }

    public void setNumPage(Integer numPage) {
        this.numPage = numPage;
    }

}
